<?php

class FIN_partnerBean
{

	
	function count_partner($db)
    {
    	$sql = "SELECT COUNT(partner_id) as total FROM ".TBL_PARTNER;
    			
    	$res = $db->get_row($sql);
    	
    	return $res->total;
    }
    function getAllPartnerSharePage($db,$langid,$share, $list){
		$page = isset ( $_GET[$list] ) ? intval ( $_GET[$list] ) : 1;
		$rows_per_page= $share;
		$page_start = ( $page - 1 ) * $rows_per_page;
		$page_end = $page * $rows_per_page;
	
		$strSQL = "SELECT * FROM ".TBL_PARTNER." n ".
				" ORDER BY n.partner_name ASC LIMIT $page_start, $rows_per_page";
		
		$res = $db->get_results($strSQL);
		return $res;	
    }
	
	function getPartnerLimit($db,$limit){
	
		$strSQL = "SELECT * FROM ".TBL_PARTNER." n ".
				" ORDER BY n.partner_id ASC LIMIT 0,$limit";
		
		$res = $db->get_results($strSQL);
		return $res;	
    }
    
}
?>